Skip to content

Conversation

@liviu-timar
Copy link
Contributor

@liviu-timar liviu-timar commented Dec 5, 2024

🎯 Goal

Fix exception that happens when using StreamCallActivity:

java.lang.RuntimeException: Unable to pause activity {com.alfamart.alfagift/com.alfamart.alfagift.screen.inappchat.call.CustomCallActivity}: java.lang.IllegalStateException: enterPictureInPictureMode: Current activity is not visible (state=STOPPING)

Cannot reproduce it, but might be caused by the activity going through RESUMED -> PAUSED -> STOPPING -> STOPPED before it gets the chance to enter PiP mode, as enterPictureInPicture is called in onPause.

🛠 Implementation details

  • Moved enterPictureInPicture call to onUserLeaveHint in StreamCallActivity to lower the chance of the activity not being visible.
  • Added exception handling.

@liviu-timar liviu-timar requested a review from a team as a code owner December 5, 2024 11:07
@liviu-timar liviu-timar force-pushed the AND-164-exception-when-entering-pip branch from 5bea6ce to b35471c Compare December 5, 2024 11:09
@aleksandar-apostolov aleksandar-apostolov changed the title Fix exception when entering PiP mode [AND-164] Fix exception when entering PiP mode Dec 5, 2024
@aleksandar-apostolov aleksandar-apostolov merged commit 8f47ccb into develop Dec 5, 2024
5 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the AND-164-exception-when-entering-pip branch December 5, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants